#pragma once
#include "resource.h"
#include "EXDialog.h"
#include "EXButton.h"
#include "EXMsgBoxResSet.h"
#include "afxwin.h"

// CEXMsgBox dialog
#define IDT_AUTO_CLOSE      1
enum DLG_POSITION
{
  CENTER_CENTER,
  CENTER_TOP,
  CENTER_LEFT,
  CENTER_RIGHT,
  CENTER_BOTTOM,
};
class AFX_EXT_CLASS CEXMsgBox : public CEXDialog
{
	DECLARE_DYNAMIC(CEXMsgBox)

public:
  enum MSGBOX_STYLE
  {
    NOIMAGE,
    MSGBOX_CTRL = 25,
  };


  CEXMsgBox(CString strText, CString strCaption, UINT uType,
    CWnd* pParent, UINT uPosition = 0, int nTime = 0);
	virtual ~CEXMsgBox();
  
  void Sound();
  void DrawLayOut();
  void SetPositionDlg();
  void SetResSet(CEXBaseResSet *pResSet);

  void SetCaption(CString strCaption);
  void SetMessageText(CString strText);
  void SetType(UINT uType);
  void SetMsgBoxPosition(UINT uPosition);
  void SetMsgBoxTime(int nTime);

// Dialog Data
	enum { IDD = IDD_MSGBOX };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()
private:
  CString m_strText;
  CString m_strCaption;
  UINT m_uType;
  int m_nTime;
  CRect m_rcText;
  UINT m_uPosition;
  CWnd *m_pParent;
  CRect m_rcDlg;
  UINT m_nImgId;
  int m_nImg_DivideCnt;
  int m_nType;

public:
  UINT m_uReturnValue;
  CEXMsgBoxResSet *m_pMsgBoxResSet;

  CEXButton m_btnCancel;
  CEXButton m_btnNo;
  CEXButton m_btnOk;
  CEXButton m_btnRetry;
  CEXButton m_btnYes;
  afx_msg void OnPaint();
  afx_msg void OnTimer(UINT_PTR nIDEvent);
  virtual BOOL OnInitDialog();
  virtual BOOL PreTranslateMessage(MSG* pMsg);
  afx_msg LRESULT OnNcHitTest(CPoint point);

  afx_msg void OnBnClickedBtnOk();
  afx_msg void OnBnClickedBtnCancel();
  afx_msg void OnBnClickedBtnRetry();
  afx_msg void OnBnClickedBtnNo();
  afx_msg void OnBnClickedBtnYes();
};
